package cn.edu.cqu.android.phone.domain;

// Generated 2011-10-7 15:57:37 by Hibernate Tools 3.4.0.CR1

import java.util.HashSet;
import java.util.Set;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.GeneratedValue;
import static javax.persistence.GenerationType.IDENTITY;
import javax.persistence.Id;
import javax.persistence.OneToMany;
import javax.persistence.Table;
import javax.persistence.UniqueConstraint;

/**
 * Users generated by hbm2java
 */
@Entity
@Table(name = "users", catalog = "myphone", uniqueConstraints = @UniqueConstraint(columnNames = "name"))
public class Users implements java.io.Serializable {

	private Integer id;
	private String name;
	private String pwd;
	private Set<Contacts> contactses = new HashSet<Contacts>(0);
	private Set<Sms> smses = new HashSet<Sms>(0);

	public Users() {
	}

	public Users(String name, String pwd) {
		this.name = name;
		this.pwd = pwd;
	}

	public Users(String name, String pwd, Set<Contacts> contactses,
			Set<Sms> smses) {
		this.name = name;
		this.pwd = pwd;
		this.contactses = contactses;
		this.smses = smses;
	}

	@Id
	@GeneratedValue(strategy = IDENTITY)
	@Column(name = "id", unique = true, nullable = false)
	public Integer getId() {
		return this.id;
	}

	public void setId(Integer id) {
		this.id = id;
	}

	@Column(name = "name", unique = true, nullable = false, length = 45)
	public String getName() {
		return this.name;
	}

	public void setName(String name) {
		this.name = name;
	}

	@Column(name = "pwd", nullable = false, length = 45)
	public String getPwd() {
		return this.pwd;
	}

	public void setPwd(String pwd) {
		this.pwd = pwd;
	}

	@OneToMany(fetch = FetchType.LAZY, mappedBy = "users")
	public Set<Contacts> getContactses() {
		return this.contactses;
	}

	public void setContactses(Set<Contacts> contactses) {
		this.contactses = contactses;
	}

	@OneToMany(fetch = FetchType.LAZY, mappedBy = "users")
	public Set<Sms> getSmses() {
		return this.smses;
	}

	public void setSmses(Set<Sms> smses) {
		this.smses = smses;
	}

}
